Active Libraries and Universal Languages

نویسندگان

  • Todd L. Veldhuizen
  • Krzysztof Czarnecki
  • Ulrich Eisenecker
  • Robert Glück
  • Sean McLennan
چکیده

Universal programming languages are an old dream. There is the computability sense of Turing-universal; Landin and others have advocated syntactically universal languages, a path leading to extensible syntax, e.g., macros. A stronger kind of universality would reduce the need for domain-specific languages — they could be replaced by ‘active libraries’ providing not just the abstractions for a problem domain but also domain-specific optimizations and safety requirements. Experience suggests that much domain-specific optimization can be realized by staging, i.e., doing computations at compile time to produce an efficient run-time. Rudimentary computability arguments show that languages with a ‘Turing-complete kernel’ can be both stage-universal and safety-universal. But making this approach practical requires compilers that find optimal programs, and this is a hard problem. Guaranteed Optimization is a proof technique for constructing compilers that find optimal programs within a decidable approximation of program equivalence. This gives us compilers whose kernels possess intuitive closure properties akin to, but stronger than, languages with explicit staging, and can meet the ‘Turing-complete kernel’ requirement to be stageand safety-universal. To show this technique is practical we demonstrate a prototype compiler that finds optimal programs in the presence of heap operations; the proof of this is tedious but automated. The proof ensures that any code ‘lying in the kernel’ is evaluated and erased at compile-time. This opens several interesting directions for active libraries. One is staging: we can synthesize fast implementation code at compile-time by putting code-generators in the kernel. To achieve domain-specific safety checking we propose ‘proof embeddings’ in which proofs are intermingled with code and the optimizer does double-duty as a theorem prover. Proofs lying in the kernel are checked and erased at compile-time, yielding code that is both fast and safe.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Stage-preserving Embeddings of Languages

Embeddings of languages into one another are useful in studying their relative power and, sometimes, finding languages that are universal in some sense. Examples include Turing-reducibility for studying computability, poly-time reductions for subrecursive languages [14], and structure-preserving embeddings for expressiveness [4, 5, 13, 12]. To further a search for languages suitable for “domain...

متن کامل

Language Embeddings that Preserve Staging and Safety

We study embeddings of programming languages into one another that preserve what reductions take place at compile-time, i.e., staging. A certain condition — what we call a 'Turing complete kernel' — is sufficient for a language to be stage-universal in the sense that any language may be embedded in it while preserving staging. A similar line of reasoning yields the notion of safety-preserving e...

متن کامل

Universal Grammar and Chaos/Complexity Theory: Where Do They Meet And Where Do They Cross?

  Abstract The present study begins by sketching "Chaos/Complexity Theory" (C/CT) and its applica-tion to the nature of language and language acquisition. Then, the theory of "Universal Grammar" (UG) is explicated with an eye to C/CT. Firstly, it is revealed that CCT may or may not be allied with a theory of language acquisition that takes UG as the initial state of language acquisition for ...

متن کامل

Multilingual Information Access: Information Retrieval and Translation in a Digital Library

Digital libraries have expanded in the recent years in scope and content to include content in a vast variety of languages. The development of technologies that enable access to this varied language information regardless of geographic or language barriers are a key factor for true global sharing of knowledge. Two such technologies that play a major role in success of multilingual digital libra...

متن کامل

A Cognitive Study of Conceptual Metaphors in English and Persian: Universal or Culture-Specific?

In the last 2 decades, studies on conceptual metaphors have profoundly increased. The development in this field was followed by Lakoff and Johnson's (1980b) work on describing the conceptual role played by metaphors and their correspondence with language and thought. This study aimed to compare conceptual metaphors in Persian and English through a corpus-based approach as well as examining both...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004